#coding=utf-8
'''
3.4. Working with Binary, Octal, and Hexadecimal Integers
bin()、oct()、hex()
format()
int()
0o
'''
x = 1234
print(bin(x))
print(oct(x))
print(hex(x))

print(format(x, 'b'))
print(format(x, 'o'))
print(format(x, 'x'))

x = -1234
print(format(x, 'b'))
print(format(x, 'o'))
print(format(x, 'x'))

print(int('4d2', 16))
print(int('10011010010', 2))

import os
os.chmod('script.py', 0o755)